//
//  DoctorMessageViewController.m
//  QuickCure
//
//  Created by huodian on 16/9/12.
//  Copyright © 2016年 haoge. All rights reserved.
//

#import "DoctorMessageViewController.h"

#import "DoctorApplyViewController.h"

#import "DoctorApplyModel.h"

#import "DoctorApplyButton.h"

@interface DoctorMessageViewController ()


@end

@implementation DoctorMessageViewController

-(DoctorApplyModel *)model
{
    if (_model == nil)
    {
        _model = [[DoctorApplyModel alloc]init];
    }
    return _model;
}

- (void)viewDidLoad {
    [super viewDidLoad];
   
    self.navigationItem.title = @"预约医生信息详情";
    
    [self getMyUI];
    
}

-(void)getMyUI
{
    //左图
    
   
    
    UIImageView* imageView1 = [[UIImageView alloc]init];
    
    imageView1.image = [UIImage imageNamed:@"banner"];
    
    
    [self.view addSubview:imageView1];
    
    
    [imageView1  mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.leading.equalTo(self.view).offset(20);
        
        make.top.equalTo(self.view).offset(10);
        
        make.width.height.equalTo(self.view).multipliedBy(0).offset(60);
    
        
    } ];
    

    
    UILabel* lable1 = [[UILabel alloc]init];
    
    lable1.text = self.model.item1;
    
    
    lable1.font = [UIFont systemFontOfSize:18];
    
    [self.view addSubview:lable1];
    
    [lable1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.equalTo(imageView1.mas_trailing).offset(20);
        
         make.top.equalTo(self.view).offset(20);
        
        make.height.equalTo(self.view).multipliedBy(0).offset(20);
        
    }];
    
    
    UILabel* lable2 = [[UILabel alloc]init];
    
    lable2.text = self.model.item2;
    
    lable2.textColor = [UIColor grayColor];
    
    lable2.font = [UIFont systemFontOfSize:16];
    
    [self.view addSubview:lable2];
    
    [lable2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.equalTo(imageView1.mas_trailing).offset(20);
        
        make.bottom.equalTo(imageView1.mas_bottom);
        
        make.height.equalTo(self.view).multipliedBy(0).offset(20);
        
    }];
    
    
 
    
    
    
    
    //第一根线
    UIView* view1 = [[UIView alloc]init];
    
    view1.backgroundColor = [UIColor grayColor];
    
    [self.view addSubview:view1];
    
    
    [view1 mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.height.equalTo(self.view).multipliedBy(0).offset(1);
        
        make.top.equalTo(imageView1.mas_bottom).offset(10);
        
        make.leading.trailing.equalTo(self.view);
        
        
    }];
    
    //右圆
    UIButton* btn = [[UIButton alloc]init];
    
    [btn setTitle:self.model.item5 forState:UIControlStateNormal];
    
    
    [self.view addSubview:btn];
    
    [btn setBackgroundColor:[UIColor colorWithRed:18 /255.0 green:176/255.0 blue:174/255.0 alpha:1]];
    
    [btn mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.view.mas_top).offset(10);
        
        make.bottom.equalTo(view1.mas_top).offset(-10);
        
        make.width.equalTo(btn.mas_height);
        
        make.centerX.equalTo(self.view.mas_trailing).offset(-50);
        
        make.centerY.equalTo(imageView1.mas_centerY);
    }];
 
    
    btn.layer.cornerRadius = 30;
    
    btn.clipsToBounds = YES;
    

   
    //
    UILabel* lable3 = [[UILabel alloc]init];
    
    lable3.text = @"预约医生:";
    
    lable3.textColor = [UIColor grayColor];
    
    lable3.font  = [UIFont systemFontOfSize:20];
    
    [self.view addSubview:lable3];
    
    [lable3 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.leading.equalTo(self.view).offset(20);
        
        make.top.equalTo(view1.mas_bottom).offset(10);
        
        make.height.equalTo(self.view).multipliedBy(0).offset(20);
        
    }];
    
    //第二根线
    UIView* view2 = [[UIView alloc]init];
    
        view2.backgroundColor = [UIColor grayColor];
    
    [self.view addSubview:view2];
    
    
    [view2 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.height.equalTo(self.view).multipliedBy(0).offset(1);
        
        make.top.equalTo(lable3.mas_bottom).offset(10);
        
        make.leading.trailing.equalTo(self.view);
        
        
    }];
    
    //医生
    UILabel* lable4 = [[UILabel alloc]init];
    
    lable4.text = self.model.item3;
    
    lable4.textColor = [UIColor blackColor];
    
    lable4.font = [UIFont systemFontOfSize:18];
    
    [self.view addSubview:lable4];
    
    [lable4 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.leading.equalTo(self.view).offset(20);
        
        make.top.equalTo(view2.mas_bottom).offset(10);
        
        make.height.equalTo(self.view).multipliedBy(0).offset(20);
        
    }];
    
    //职称
//    UILabel* lable5 = [[UILabel alloc]init];
//    
//    lable5.text = self.model.item4;
//    
//    lable5.textColor = [UIColor grayColor];
//    
//    lable5.font = [UIFont systemFontOfSize:16];
//   
//    
//    [self.view addSubview:lable5];
//    
//    [lable5 mas_makeConstraints:^(MASConstraintMaker *make) {
//        
//        make.leading.equalTo(lable4.mas_trailing).offset(20);
//        
//        make.top.equalTo(view2.mas_bottom).offset(10);
//        
//        make.height.equalTo(self.view).multipliedBy(0).offset(20);
//        
//    }];
    
    //医院
    
    UILabel* lable6 = [[UILabel alloc]init];
    
    lable6.text = self.model.item4;
    
    lable6.textColor = [UIColor grayColor];
    
    lable6.font = [UIFont systemFontOfSize:16];
    
    [self.view addSubview:lable6];
    
    [lable6 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.leading.equalTo(self.view).offset(20);
        
        make.top.equalTo(lable4.mas_bottom).offset(10);
        
        make.height.equalTo(self.view).multipliedBy(0).offset(20);
        
    }];
    
    
    //第三根线
    
    UIView* view3 = [[UIView alloc]init];
    
        view3.backgroundColor = [UIColor grayColor];
    
    [self.view addSubview:view3];
    
    
    [view3 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.height.equalTo(self.view).multipliedBy(0).offset(1);
        
        make.top.equalTo(lable6.mas_bottom).offset(10);
        
        make.leading.trailing.equalTo(self.view);
        
        
    }];
    
    //反馈框
    
    UIButton* btn2 = [[UIButton alloc]init];
    
    [btn2 setTitle:@"反馈意见" forState:UIControlStateNormal];
    
    [self.view addSubview:btn2];
    
    [btn2 setBackgroundColor:[UIColor colorWithRed:18 /255.0 green:176/255.0 blue:174/255.0 alpha:1]];
    
    [btn2 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(view2.mas_bottom).offset(20);
        
        make.bottom.equalTo(view3.mas_top).offset(-20);
        
        make.trailing.equalTo(self.view).offset(-20);
        
       make.width.equalTo(self.view).multipliedBy(0).offset(100);
//
//        make.centerX.equalTo(self.view.mas_trailing).offset(-50);
//        
//        make.centerY.equalTo(imageView1.mas_centerY);
    }];
    
    btn2.clipsToBounds = YES;
    
    btn2.layer.cornerRadius = 5;
    
    
    //预约须知
    
    UILabel* lable7 = [[UILabel alloc]init];
    
    lable7.text = @"预约须知:";
    
    lable7.textColor = [UIColor grayColor];
    
    lable7.font  = [UIFont systemFontOfSize:20];
    
    [self.view addSubview:lable7];
    
    [lable7 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.leading.equalTo(self.view).offset(20);
        
        make.top.equalTo(view3.mas_bottom).offset(10);
        
        make.height.equalTo(self.view).multipliedBy(0).offset(20);
        
    }];
    
    //第四根线
    
    UIView* view4 = [[UIView alloc]init];
    
        view4.backgroundColor = [UIColor grayColor];
    
    [self.view addSubview:view4];
    
    
    [view4 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.height.equalTo(self.view).multipliedBy(0).offset(1);
        
        make.top.equalTo(lable7.mas_bottom).offset(10);
        
        make.leading.trailing.equalTo(self.view);
        
        
    }];
    
    //就诊地点
    
    UILabel* lable8 = [[UILabel alloc]init];
    
    lable8.text = @"就诊地点:";
    
    lable8.font = [UIFont systemFontOfSize:20];
    
    [self.view addSubview:lable8];
    
    [lable8 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.leading.equalTo(self.view).offset(20);
        
        make.top.equalTo(view4.mas_bottom).offset(10);
        
        make.height.equalTo(self.view).multipliedBy(0).offset(20);
        
    }];
    
    
    
    UILabel* lable9 = [[UILabel alloc]init];
    
    lable9.text = @"上海长征医院2号楼心血管内科";
    
    lable9.font = [UIFont systemFontOfSize:16];
    
    lable9.textColor = [UIColor grayColor];
    
    [self.view addSubview:lable9];
    
    [lable9 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.leading.equalTo(lable8.mas_trailing).offset(20);
        
        make.top.equalTo(view4.mas_bottom).offset(10);
        
        make.height.equalTo(self.view).multipliedBy(0).offset(20);
        
    }];
    
    //取号时间
    
    UILabel* lable10 = [[UILabel alloc]init];
    
    lable10.text = @"取号时间:";
    
    lable10.font = [UIFont systemFontOfSize:20];
    
    [self.view addSubview:lable10];
    
    [lable10 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.leading.equalTo(self.view).offset(20);
        
        make.top.equalTo(lable8.mas_bottom).offset(10);
        
        make.height.equalTo(self.view).multipliedBy(0).offset(20);
        
    }];
    
    UILabel* lable11 = [[UILabel alloc]init];
    
    lable11.text = @" 9:00 - 10:00 ";
    
    lable11.font = [UIFont systemFontOfSize:16];
    
    lable11.textColor = [UIColor grayColor];
    
    [self.view addSubview:lable11];
    
    [lable11 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.leading.equalTo(lable10.mas_trailing).offset(20);
        
        make.top.equalTo(lable9.mas_bottom).offset(10);
        
        make.height.equalTo(self.view).multipliedBy(0).offset(20);
        
    }];
    
    //取号地址
    
    
    UILabel* lable12 = [[UILabel alloc]init];
    
     lable12.text = @"取号地址:";
    
    lable12.font = [UIFont systemFontOfSize:20];
    
    [self.view addSubview:lable12];
    
    [lable12 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.leading.equalTo(self.view).offset(20);
        
        make.top.equalTo(lable10.mas_bottom).offset(10);
        
        make.height.equalTo(self.view).multipliedBy(0).offset(20);
        
    }];
    
    UILabel* lable13 = [[UILabel alloc]init];
    
    lable13.text = @"上海长征医院住院部";
    
    lable13.font = [UIFont systemFontOfSize:16];
    
    lable13.textColor = [UIColor grayColor];
    
    [self.view addSubview:lable13];
    
    [lable13 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.leading.equalTo(lable12.mas_trailing).offset(20);
        
        make.top.equalTo(lable11.mas_bottom).offset(10);
        
        make.height.equalTo(self.view).multipliedBy(0).offset(20);
        
    }];
    
    //第五根线
    UIView* view5 = [[UIView alloc]init];
    
        view5.backgroundColor = [UIColor grayColor];
    
    [self.view addSubview:view5];
    
    
    [view5 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.height.equalTo(self.view).multipliedBy(0).offset(1);
        
        make.top.equalTo(lable12.mas_bottom).offset(10);
        
        make.leading.trailing.equalTo(self.view);
        
        
    }];
    
    //底线两个按钮
    
    DoctorApplyButton* btn1 = [[DoctorApplyButton alloc]init];
    
    [btn1 setTitle:@"重发短信" forState:UIControlStateNormal];
    
    [btn1 setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    
//    [btn1 setBackgroundColor:[UIColor whiteColor]];
    
    

    
//    CALayer * downButtonLayer = [btn1 layer];
//    
//    [downButtonLayer setMasksToBounds:YES];
//    
//    [downButtonLayer setCornerRadius:10.0];
//    
//    [downButtonLayer setBorderWidth:1.0];
//    
//    [downButtonLayer setBorderColor:[[UIColor grayColor] CGColor]];
    
    [self.view addSubview:btn1];
    
    [btn1 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.leading.equalTo(self.view).offset(40);
        
        make.bottom.equalTo(self.view).offset(-30);
        
        make.width.equalTo(self.view).multipliedBy(0).offset(150);
        
        make.height.equalTo(self.view).multipliedBy(0).offset(30);
        
    }];
    
   
    
 
    

    
    
    
    DoctorApplyButton* btn3 = [[DoctorApplyButton alloc]init];
    
    [btn3 setTitle:@"取消预约" forState:UIControlStateNormal];
    
    [btn3 setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
   
    
    [self.view addSubview:btn3];
 
    
    [btn3 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.trailing.equalTo(self.view).offset(-40);
        
        make.bottom.equalTo(self.view).offset(-30);
        
        make.width.equalTo(self.view).multipliedBy(0).offset(150);
        
        make.height.equalTo(self.view).multipliedBy(0).offset(30);
        
        
    }];
    

    
}






@end
